#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <aclconio.h>
#include <define.h>
#include <transact.h>
#include <tran.h>
#include <gds.h>
#include <sizes.h>
#include <\SOFTPAY\Ver30\source\include\sizes.h>
#include <\SOFTPAY\Ver30\HostSrc\citisrc\citiids.h>
#include <\SOFTPAY\Ver30\HostSrc\cpacsrc\cpacids.h>
#include <confio.h>

#include <\SOFTPAY\Ver30\source\include\GPT.h>

const char*GPTName = "GPT.dat";

static GPT_REC srGPTRec;

static int recordNum;
int	inLoadGPTRec (int inRecNumber)
{
	int inRet;

	inRet = inLoadConfRec(GPT_FILENAME, SIZE_GPT_REC, inRecNumber, (char *) &srGPTRec);

	recordNum = inRecNumber;
	return inRet;
}

void *pvdGetGPTRec(void)
{
	return &srGPTRec;

}

int	inSaveGPTRec (int inRecNumber)
{
	int inRet;

	inRet = inSaveConfRec(GPT_FILENAME, SIZE_GPT_REC, inRecNumber, (char *) &srGPTRec);

	return inRet;
}

int	inGetGPTRecNumber (void)
{
	return recordNum;
}

int	inUpdateGPTRec (void)
{
	int inRet;

	inRet = inSaveConfRec(GPT_FILENAME, SIZE_GPT_REC, recordNum, (char *) &srGPTRec);

	return inRet;
}

void	vdResetGPTRec (void)
{
	memset((void*)&srGPTRec, 0, REC_SIZEOF(srGPTRec));
}

char* szGetGPRSModelNo(void)
{
	return srGPTRec.szGPRSModelNo;
}

void vdSetGPRSModelNo(const char* szGPRSModelNo)
{
	strNumCopy(srGPTRec.szGPRSModelNo, szGPRSModelNo, sizeof(((GPT_REC*)NULL)->szGPRSModelNo)-1);
}

char* szGetUsername(void)
{
	return srGPTRec.szUsername;
}

void vdSetUsername(const char* szUsername)
{
	strNumCopy(srGPTRec.szUsername, szUsername, sizeof(((GPT_REC*)NULL)->szUsername)-1);
}

char* szGetPassword(void)
{
	return srGPTRec.szPassword;
}

void vdSetPassword(const char* szPassword)
{
	strNumCopy(srGPTRec.szPassword, szPassword, sizeof(((GPT_REC*)NULL)->szPassword)-1);
}

char* szGetTerminalIP(void)
{
	return srGPTRec.szTerminalIP;
}

void vdSetTerminalIP(const char* szTerminalIP)
{
	strNumCopy(srGPTRec.szTerminalIP, szTerminalIP, sizeof(((GPT_REC*)NULL)->szTerminalIP)-1);
}

char* szGetSubNetMask1(void)
{
	return srGPTRec.szSubNetMask1;
}

void vdSetSubNetMask1(const char* szSubNetMask1)
{
	strNumCopy(srGPTRec.szSubNetMask1, szSubNetMask1, sizeof(((GPT_REC*)NULL)->szSubNetMask1)-1);
}

char* szGetAPN(void)
{
	return srGPTRec.szAPN;
}

void vdSetAPN(const char* szAPN)
{
	strNumCopy(srGPTRec.szAPN, szAPN, sizeof(((GPT_REC*)NULL)->szAPN)-1);
}

char* szGetPhoneNoGprs(void)
{
	return srGPTRec.szPhoneNoGprs;
}

void vdSetPhoneNoGprs(const char* szPhoneNoGprs)
{
	strNumCopy(srGPTRec.szPhoneNoGprs, szPhoneNoGprs, sizeof(((GPT_REC*)NULL)->szPhoneNoGprs)-1);
}

char* szGetPrevT2Data(void)
{
	return srGPTRec.szPrevT2Data;
}

void vdSetPrevT2Data(const char* szPrevT2Data)
{
	strNumCopy(srGPTRec.szPrevT2Data, szPrevT2Data, sizeof(((GPT_REC*)NULL)->szPrevT2Data)-1);
}

VS_BOOL fGetForceReboot(void)
{
	return srGPTRec.fForceReboot;
}

void vdSetForceReboot(VS_BOOL fForceReboot)
{
	srGPTRec.fForceReboot = fForceReboot;
}

VS_BOOL fGetTrack2Encrypt(void)
{
	return srGPTRec.fTrack2Encrypt;
}

void vdSetTrack2Encrypt(VS_BOOL fTrack2Encrypt)
{
	srGPTRec.fTrack2Encrypt = fTrack2Encrypt;
}

VS_BOOL fGetHexHeader(void)
{
	return srGPTRec.fHexHeader;
}

void vdSetHexHeader(VS_BOOL fHexHeader)
{
	srGPTRec.fHexHeader = fHexHeader;
}

VS_BOOL fGetReserved5(void)
{
	return srGPTRec.fReserved5;
}

void vdSetReserved5(VS_BOOL fReserved5)
{
	srGPTRec.fReserved5 = fReserved5;
}

VS_BOOL fGetReserved4(void)
{
	return srGPTRec.fReserved4;
}

void vdSetReserved4(VS_BOOL fReserved4)
{
	srGPTRec.fReserved4 = fReserved4;
}

VS_BOOL fGetReserved3(void)
{
	return srGPTRec.fReserved3;
}

void vdSetReserved3(VS_BOOL fReserved3)
{
	srGPTRec.fReserved3 = fReserved3;
}

VS_BOOL fGetReserved2(void)
{
	return srGPTRec.fReserved2;
}

void vdSetReserved2(VS_BOOL fReserved2)
{
	srGPTRec.fReserved2 = fReserved2;
}

VS_BOOL fGetReserved1(void)
{
	return srGPTRec.fReserved1;
}

void vdSetReserved1(VS_BOOL fReserved1)
{
	srGPTRec.fReserved1 = fReserved1;
}

